dash(S8): DASHWorkSource concrete IWorkSource -- 4b .cpp bodies + dash_stratum OBJECT lib + KAT#706
Merged
Merged
Conversation
frstrtr
force-pushed
the
dash/s8-stratum-work-source
branch
2 times, most recently
from
July 15, 2026 04:50
0cf49eb to
4c4ca58
Compare
4a skeleton mirroring dgb::stratum::DGBWorkSource: concrete core::stratum::IWorkSource for DASH (X11). Declares the fused get_work() member the get_work.hpp capstone forward-refs as the eventual DASHWorkSource::get_work(); holds the node-held coin-state embedded arm + the always-reachable dashd GBT RPC fallback (never removed -- safety/[GBT-XCHECK]). All work-gen/submit methods are MVP-default; .cpp bodies + CMake OBJECT wiring + instantiation KAT land in the follow-on 4b commit once #698 is on master. Header-only declaration; not yet in any build target (inert). Stacked on #698 (get_work.hpp); held per integrator until #698 lands to avoid a stacked-PR auto-close.
Stage 4b for the DASHWorkSource stratum accept-loop seam (follow-on to the
4a header skeleton). Gives the concrete core::stratum::IWorkSource a linkable
definition so it is INSTANTIABLE and holdable via shared_ptr<IWorkSource> by a
future core::StratumServer, before the substantive X11 work-assembly lands.
work_source.cpp (new):
- constructor binding the NON-OWNING NodeCoinState reference (embedded arm),
the REQUIRED dashd getblocktemplate fallback closure (GBT-XCHECK safety,
never removed), and the dual-path won-block submit callback;
- real bodies: get_best_share_hash_fn / set_best_share_hash_fn (locked),
has_merged_chain (false, standalone X11), the per-connection worker
registry (register/update/unregister, idempotent on unknown sessions);
- fused get_work() adapter over the free dash::stratum::get_work() capstone
(#698): embedded when the coin-state is populated, retained dashd fallback
on a set-gap;
- work-generation / coinbase / mining_submit / compute_share_difficulty held
at documented SAFE DEFAULTS (empty template, reject, 0.0 sentinel) for
4c/4d -- mirrors dgb::stratum::DGBWorkSource 4a->4b->4c->4d progression.
dash_stratum OBJECT lib (stratum/CMakeLists.txt + add_subdirectory): SAFE-ADDITIVE,
compiled here, linked only by the KAT now (and c2pool-dash in a later slice), so
ltc/btc/doge/dgb build + ctest surfaces stay untouched. Per-coin isolation held:
src/impl/dash only, dashd RPC fallback preserved.
test_dash_stratum_work_source (new, 11 KATs, Linux x86_64 11/11): construction +
full IWorkSource contract, config defaults, work-generation counter, share-target
atomics, worker registry, best-share callback, 4b safe-default assertions, and the
fused get_work() routing to the retained dashd fallback on an unpopulated
coin-state. Added to BOTH build.yml --target allowlists (NOT_BUILT sentinel guard).
frstrtr
force-pushed
the
dash/s8-stratum-work-source
branch
from
July 15, 2026 10:04
4c4ca58 to
6de623b
Compare
This was referenced Jul 15, 2026
frstrtr
added a commit
that referenced
this pull request
Jul 16, 2026
…HWorkSource standup Closes the S8 "no run-path caller" gap: the DASHWorkSource IWorkSource seam (#706, 4a skeleton + 4b bodies) and the subscribe->notify->submit KATs (#630-634) had no production caller — a real main that constructs the work source and binds a core::StratumServer to it. This is that caller. - main_dash.cpp: --stratum [HOST:]PORT argv (SSOT parse_listen); threaded into run_node; node_coin_state -> DASHWorkSource -> StratumServer standup; won-block dispatch via the EXISTING dashd-RPC submitblock arm (rpc->submit_block_hex) — embedded P2P relay leg stays S8; UNARMED path logs loudly, never a silent drop. Destruction order: stratum_server declared before the work source it references; explicit reset() after ioc.run(). dashd-RPC fallback RETAINED (never removed). - src/c2pool/CMakeLists.txt: link dash_stratum into c2pool-dash (the 4b work_source.cpp bodies) — without it the executable failed to link (undefined DASHWorkSource ctor). Build-glue for the caller. Verified Linux x86_64: c2pool-dash links clean; --run --stratum 127.0.0.1:13333 stands up the acceptor (DASHWorkSource constructed, StratumServer bound, clean stop). subscribe->notify->submit binding is KAT-covered at the work_source seam (#630-634). No other-coin / shared- base edit; per-coin isolation held.
frstrtr
added a commit
that referenced
this pull request
Jul 16, 2026
…HWorkSource standup Closes the S8 "no run-path caller" gap: the DASHWorkSource IWorkSource seam (#706, 4a skeleton + 4b bodies) and the subscribe->notify->submit KATs (#630-634) had no production caller — a real main that constructs the work source and binds a core::StratumServer to it. This is that caller. - main_dash.cpp: --stratum [HOST:]PORT argv (SSOT parse_listen); threaded into run_node; node_coin_state -> DASHWorkSource -> StratumServer standup; won-block dispatch via the EXISTING dashd-RPC submitblock arm (rpc->submit_block_hex) — embedded P2P relay leg stays S8; UNARMED path logs loudly, never a silent drop. Destruction order: stratum_server declared before the work source it references; explicit reset() after ioc.run(). dashd-RPC fallback RETAINED (never removed). - src/c2pool/CMakeLists.txt: link dash_stratum into c2pool-dash (the 4b work_source.cpp bodies) — without it the executable failed to link (undefined DASHWorkSource ctor). Build-glue for the caller. Verified Linux x86_64: c2pool-dash links clean; --run --stratum 127.0.0.1:13333 stands up the acceptor (DASHWorkSource constructed, StratumServer bound, clean stop). subscribe->notify->submit binding is KAT-covered at the work_source seam (#630-634). No other-coin / shared- base edit; per-coin isolation held.
frstrtr
added a commit
that referenced
this pull request
Jul 16, 2026
…HWorkSource standup (#715) Closes the S8 "no run-path caller" gap: the DASHWorkSource IWorkSource seam (#706, 4a skeleton + 4b bodies) and the subscribe->notify->submit KATs (#630-634) had no production caller — a real main that constructs the work source and binds a core::StratumServer to it. This is that caller. - main_dash.cpp: --stratum [HOST:]PORT argv (SSOT parse_listen); threaded into run_node; node_coin_state -> DASHWorkSource -> StratumServer standup; won-block dispatch via the EXISTING dashd-RPC submitblock arm (rpc->submit_block_hex) — embedded P2P relay leg stays S8; UNARMED path logs loudly, never a silent drop. Destruction order: stratum_server declared before the work source it references; explicit reset() after ioc.run(). dashd-RPC fallback RETAINED (never removed). - src/c2pool/CMakeLists.txt: link dash_stratum into c2pool-dash (the 4b work_source.cpp bodies) — without it the executable failed to link (undefined DASHWorkSource ctor). Build-glue for the caller. Verified Linux x86_64: c2pool-dash links clean; --run --stratum 127.0.0.1:13333 stands up the acceptor (DASHWorkSource constructed, StratumServer bound, clean stop). subscribe->notify->submit binding is KAT-covered at the work_source seam (#630-634). No other-coin / shared- base edit; per-coin isolation held. Co-authored-by: frstrtr <frstrtr@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
S8 stratum leaf, unblocked by #698 (get_work capstone) merge.
Adds the concrete dash::stratum::DASHWorkSource (core::stratum::IWorkSource) that bridges the coin-agnostic core::StratumServer to DASH X11/V36 work generation + share validation.
Scope (4b bodies):
Invariants: SAFE-ADDITIVE, single-coin (src/impl/dash only), per-coin isolation held, dashd RPC fallback preserved. Rebased onto current master (bcf0187); both commits GPG-signed. Registered via gtest_add_tests AUTO + present in both build.yml --target allowlists (L117 + L267).
No self-merge -- requesting integrator verify (oracle parity vs frstrtr/p2pool-dash + full Linux x86_64 CI) then operator tap.